package main.com.smartagriculture.observer;

import main.com.smartagriculture.observer.Observer;
import main.com.smartagriculture.sensor.EnvironmentSensor;

public class ConcreteObserver implements Observer {
    private String name;

    public ConcreteObserver(String name) {
        this.name = name;
    }

    @Override
    public void update(EnvironmentSensor sensor) {
        System.out.println(name + " 收到 " + sensor.getType() + " 传感器数据：" + sensor.getData());
    }
}